package echo.demo2;

import echo.future.DefaultFuture;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class Demo {
    public static void main(String[] args) throws InterruptedException {
        Client client = new Client();
        ExecutorService executorService = Executors.newFixedThreadPool(10);
        for (int i = 0; i < 100000; i++) {
            int finalI1 = i;
            executorService.submit(() -> {
                String sendStr = "" + finalI1;
                DefaultFuture send = client.send(sendStr);
                try {
                    Object o = send.get();
                    System.out.println(send);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
            });
            System.out.println("asfd"+i);
        }
    }
}

